package com.example.demo0331.controller;

import com.example.demo0331.entity.Goods;
import com.example.demo0331.mapper.GoodsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class GoodsController {

    @Autowired
    private GoodsMapper goodsMapper;
    @GetMapping("goods")
    public List<Goods> all() {
        return goodsMapper.all();
    }
}
